﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="wfCustOrderRate.aspx.cs" Inherits="msBsc.WebUi.wfCustOrderRate" %>

<!DOCTYPE HTML>
<html>
<head id="Head1" runat="server"> 
    <title>评价</title> 
    <link rel="shortcut icon" href="/themes/Style1/Image/favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="/??themes/Style1/StyleQt.css,themes/Style1/cRateInd.css,jqPlugin/kindeditor/themes/default/default.css" />  

    <script src="/??jqPlugin/js/jquery-1.8.3.min.js,js/jBase.js,js/jBPage.js,themes/Style1/jsQt.js,jqPlugin/kindeditor/kindeditor.js,jqPlugin/kindeditor/lang/zh_CN.js"
        type="text/javascript"></script>
    <!--head fix rgn-->
    <script type="text/javascript">
        K = KindEditor;
        K.DEBUG = true;
        K.basePath = K.options.basePath = '/jqPlugin/kindeditor/';
        K.options.themesPath = K.options.basePath + 'themes/';
        K.options.langPath = K.options.basePath + 'lang/';
        K.options.pluginsPath = K.options.basePath + 'plugins/';
//        function getfilequery() {
//            return "&ParentId=" + $("#txtCurrDirId").val()
//                                    + "&FileId=" + ""
//                                    + "&RelId=" + ""
//                                    + "&rType1=" + "1"
//                                    + "&rType2=" + "0";
//        };
        $(window).load(function () {
            var editor = K.editor({
                allowFileManager: true
            });

            $('.ks-simplestar img').live("mouseover", function () {
                !$(this).parent().hasClass("selected-rate") && $(this).attr("src", "/themes/Style1/Image/ratesel.png").prevAll().attr("src", "/themes/Style1/Image/ratesel.png");
            }).live("mouseout", function () {
                !$(this).parent().hasClass("selected-rate") && $(this).attr("src", "/themes/Style1/Image/ratenotsel.png").prevAll().attr("src", "/themes/Style1/Image/ratenotsel.png");
            }).live('click', function () {
                if ($(this).parent().hasClass("setview")) { return; }
                $(this).parent().removeClass("selected-rate").addClass("selected-rate").attr('rate-num', $(this).attr('rate-num'));
                $(this).attr("src", "/themes/Style1/Image/ratesel.png").prevAll().attr("src", "/themes/Style1/Image/ratesel.png");
                $(this).nextAll().attr("src", "/themes/Style1/Image/ratenotsel.png");
                $(this).parent().next().html('<strong>' + $(this).attr('rate-num') + '分</strong> - ' + $(this).attr('title'));
            });

            $('.upload-queue img').live('dblclick', function () {
                $(this).parent().remove();
            });
            $('.upload-btn').live('click', function () {
                editor.uploadJson = '/pgajax.axd?F_UPLOAD=1&blSave=0&COOKATHID=' + (typeof (cookesc) == "undefined" ? "" : cookesc)
                                    + "&fType=" + "image";
                //                                    + getfilequery();
                var $imgul = $(this).next();
                editor.loadPlugin('multiimage', function () {
                    editor.plugin.multiImageDialog({
                        onClose: function () {
                        }
                        , clickFn: function (urlList) {
                            if (urlList && urlList.length > 0) {
                                for (var i = 0; i < urlList.length; i++) {
                                    if ($imgul.find(" img").length < 5) {
                                        $imgul.append('<li><img alt="" src="' + urlList[i].url + '" for="' + urlList[i].url + '" style="width:45px;height:40px;"></li>');
                                    }
                                }
                            }
                            editor.hideDialog();
                        }
                    });
                });
            });
            $(".submit-btn").click(function () {
                dosaverate();
            });


            $(".tm-m-photos-thumb li").live("click", function () {
                var $self = $(this);
                if ($self.hasClass("tm-current")) {
                    $self.parent().next().hide();
                    $self.removeClass("tm-current");
                } else {
                    $self.parent().next().show('fast');
                    $self.addClass("tm-current");
                    $self.prevAll().removeClass("tm-current");
                    $self.nextAll().removeClass("tm-current");
                    $self.parent().next().find(" img").attr("src", $self.find(" img").attr("src"));
                    var htem3 = $self.parent().next().find(" img").height();
                    var wtem3 = $self.parent().next().find(" img").width();
                    if (parseInt(htem3.toString().replace('px', '')) < 250) {
                        $self.parent().next().height(htem3);
                    } else {
                        $self.parent().next().height("250px");
                    }
                    if (parseInt(wtem3.toString().replace('px', '')) < 250) {
                        $self.parent().next().width(wtem3);
                    } else {
                        $self.parent().next().width("250px");
                    }
                }
            });
        });

        function setsimplestar(scid, snum) {
            var $imgtem1 = $("#" + scid + " img[rate-num='" + snum + "']");
            $imgtem1.attr("src", "/themes/Style1/Image/ratesel.png").prevAll().attr("src", "/themes/Style1/Image/ratesel.png");
            $imgtem1.parent().next().html('<strong>' + $imgtem1.attr('rate-num') + '分</strong> - ' + $imgtem1.attr('title'));
        };

        function dosaverate() { 
            var _jsParam = new jsonRow();
            _jsParam.AddCell("ACTION", "dosaverate");
            _jsParam.AddCell("ID", $("#txtId").val());
            var i = 0;
            var blRateSel = true;
            $(".rate-box").each(function () {
                _jsParam.AddCell("ORDER_LIST_ID_" + i, $(this).attr('data-id'));
                var chkratenum = $(this).find('input:radio:checked').val();
                if (chkratenum != null && chkratenum != undefined) {
                    _jsParam.AddCell("BUYER_RATE_NUM_" + i, chkratenum);
                } else {
                    alert("请选择评价！");
                    blRateSel = false;
                    return;
                }
                _jsParam.AddCell("BUYER_RATE_DESC1_" + i, $(this).find(" textarea").val());
                var r = 0;
                $(this).find('.upload-queue img').each(function () {
                    _jsParam.AddCell("GOODS_IMG_URL_" + i + "_" + r, $(this).attr("for"));
                    r++;
                });
                i++;
            });
            if (!blRateSel) {
                return;
            } 
            blRateSel = false;
            $('#liDESC_MATCH_RATE .selected-rate').each(function () {
                _jsParam.AddCell("DESC_MATCH_RATE", $(this).attr('rate-num'));
                blRateSel = true;
            });
            if (!blRateSel) {
                alert("请给宝贝与描述相符打分！");return;
            } 
            blRateSel = false;
            $('#liSERVICE_RATE .selected-rate').each(function () {
                _jsParam.AddCell("SERVICE_RATE", $(this).attr('rate-num'));
                blRateSel = true;
            });
            if (!blRateSel) {
                alert("请给卖家的服务态度打分！"); return;
            }
            blRateSel = false;
            $('#liSEND_SPEED .selected-rate').each(function () {
                _jsParam.AddCell("SEND_SPEED", $(this).attr('rate-num'));
                blRateSel = true;
            });
            if (!blRateSel) {
                alert("请给卖家发货的速度打分！"); return;
            }

            ajaxComm(_jsParam);

        };
    </script> 
</head>
<body>
    <div id="mallPage" class="tms-page mallAct tmall-  page-not-market">
        <!-- -->
        <!--商城通用顶通-->
        <%=new msBsc.WebUi.Code.QtHtmlGet().GetHeaderTopHtml()%> 
        <%=new msBsc.WebUi.Code.QtHtmlGet().GetHeaderLogoHtml()%> 
        <div id="content" style="width:990px;">
            <div class="line top-line clearfix rate-item">
                <h3 class="top-line-title ">
                    <span class="page-title">评价宝贝</span>
                </h3>
                <ul class="header-nav">
                    <%=GetHeaderNav()%>
                </ul>
            </div>
 
  
<!--评价 START-->
<div class="line rate">
    <form id="rateListForm" class="remark-form">
    <div class="itemlist">
        <fieldset>
        

            <ul class="rate-list">
            <%=GetRateList() %> 
            </ul>
        </fieldset>
        <fieldset>
            <div class="dsr-box">
                <h2 class="dsr-title">
                    <span>店铺动态评分</span> <b class="arrow-right"></b><b class="arrow-right arrow-right-top">
                    </b>
                </h2>
                <ul class="stars">
                <%=GetShopSvcLi()%>
                </ul>
            </div>
        </fieldset>
    </div>
    <div class="submitbox">
        <button type="button" class="submit submit-btn" style="display:none;">
            提交评论</button>
    </div>
    </form>
</div>
<!--评价 END-->
   
				
			</div>
        <%=new msBsc.WebUi.Code.QtHtmlGet().GetFloorHtml()%>
    </div>
    <input type="hidden" id="txtId" value="">
    <!-- foot script -->
</body>
</html>
 